package com.sinog.biz.schedule;

import com.sinog.biz.schedule.async.AsyncSql;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @desc 定时任务：定时拉取司法部下发的：帮教资料、经验推介、通知公告、政策文件、上报协调 每30分钟执行一次
 * @author lzq
 * @date 2021-09-20 00:02
 */
@Slf4j
@Component
@Configuration
@ConditionalOnProperty(name = "gkzx.azbj.tzgg.open", havingValue = "true")
public class TzggSchedule {

    @Autowired
    private AsyncSql asyncSql;

    /**
     * 帮教资料、经验推介、通知公告、政策文件、上报协调
     * 拉取部级数据
     */
    @Scheduled(cron = "${gkzx.azbj.tzgg.cron}")
    public void findExecuteSql() {
        asyncSql.findBjzl();
        asyncSql.findJytj();
        asyncSql.findTzgg();
        asyncSql.findZcwj();
        asyncSql.findSbxt();
    }
}